package com.eonmind.ai.service.impl;

import com.eonmind.ai.mapper.AiMessageMapper;
import com.eonmind.ai.service.IAiMessageService;
import com.eonmind.common.provider.entity.ai.AiConversationMessage;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Ai消息服务
 *
 * @author Xujie
 * @since 2025/5/7 20:53
 **/

@Slf4j
@Service
public class AiMessageService implements IAiMessageService {
    @Resource
    private AiMessageMapper aiMessageMapper;

    @Override
    public void saveBatch(List<AiConversationMessage> chatMessageList) {
        aiMessageMapper.saveBatch(chatMessageList);
    }

    @Override
    public List<AiConversationMessage> selectByConversationIdAndLimit(Long conversationId, int lastN) {

        return aiMessageMapper.selectByConversationIdAndLimit(conversationId, lastN);
    }

    @Override
    public void deleteByConversationId(Long conversationId) {

    }
}
